#include <REGX52.H>
#include "LCD1602.h"
#include "Delay.h"
#include "B20.h"
float t=0;

void main()
{
	LCD_Init();
	B20_ConvertT();
	Delay(750);
	LCD_ShowString(1,1,"Temperture:");
	while(1)
	{
		B20_ConvertT();
	  t=B20_ReadT();
		if(t>0)
		{
			LCD_ShowChar(2,1,'+');
		}
		else
		{
			LCD_ShowChar(2,1,'-');
			t=-t;
		}
		LCD_ShowNum(2,2,t,3);
		LCD_ShowChar(2,5,'.');
		LCD_ShowNum(2,6,(unsigned long)(t*10000)%10000,4);
	}
}
